package com.myersinfosys.protrack.vfs;


import java.util.List;

import org.apache.commons.vfs.FileSystemException;

/** vfs - main - used for beta testing FileSession classes.
*
* @author E.Morris
* @version 4/15/2011
*/
public class vfs {

	public static void main(String[] args) {
		
		FileSessionManager manager=null;
		FileSessionConnector myVfs=null;
		boolean includeChildren = true;
		boolean overwrite = false;
		
		try {
			manager = new FileSessionManager();
			// start a new session
			myVfs = new FileSessionConnector(manager, "mytestftp", "mytestsmb");
			
			//myVfs.copyFiles("Movie-0001.mpg", false);
			myVfs.moveFiles("level1", includeChildren, overwrite);
			
			List<String> listDestination = myVfs.listFilesFromDestination("*", includeChildren);
			
			for(String s : listDestination) {
				System.out.println(s);
			}

		} catch (FileSystemException e) {
			e.printStackTrace();
		}finally {
			if(myVfs!=null) {
				// close the session
				myVfs.closeFileSessionConnector();
			}
			if(manager!=null) {
				// close the manager
				manager.closeManager();
			}
		}
	}
}